home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / CIncludes / Windows.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-05  |  20.6 KB  |  530 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Windows.h
  3.  
  4.      Contains:    Window Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.1.3
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __WINDOWS__
  21. #define __WINDOWS__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __MEMORY__
  30. #include <Memory.h>
  31. #endif
  32. /*    #include <MixedMode.h>                                        */
  33.  
  34. #ifndef __QUICKDRAW__
  35. #include <Quickdraw.h>
  36. #endif
  37. /*    #include <QuickdrawText.h>                                    */
  38.  
  39. #ifndef __EVENTS__
  40. #include <Events.h>
  41. #endif
  42. /*    #include <OSUtils.h>                                        */
  43.  
  44. #ifndef __CONTROLS__
  45. #include <Controls.h>
  46. #endif
  47. /*    #include <Menus.h>                                            */
  48.  
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52.  
  53. #if PRAGMA_ALIGN_SUPPORTED
  54. #pragma options align=mac68k
  55. #endif
  56.  
  57. #if PRAGMA_IMPORT_SUPPORTED
  58. #pragma import on
  59. #endif
  60.  
  61. /*
  62. *****************************************************************************
  63. *                                                                           *
  64. * The conditional STRICT_WINDOWS has been removed from this interface file. *
  65. * The accessor macros to a WindowRecord are no longer necessary.            *
  66. *                                                                           *
  67. *****************************************************************************
  68.  
  69. Details:
  70. The original purpose of the STRICT_ conditionals and accessor macros was to
  71. help ease the transition to Copland.   Shared data structures are difficult
  72. to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  73. WindowRecord and other data structures, we would begin the migration to 
  74. system data structures being completely hidden from applications. 
  75.  
  76. After many design reviews, it was finally concluded that with this sort of
  77. migration, the system could never tell when an application was no longer 
  78. peeking at a WindowRecord, and thus the data structure might never become 
  79. system owned.  Additionally, there were many other limitations in the classic
  80. toolbox that were begging to be addressed.
  81.  
  82. The final decision was to leave the traditional toolbox as a compatibility mode.
  83. The preferred toolbox API for Copland is a new SOM(tm) based architecture 
  84. (e.g. HIWindows.idl).  Windows, menu, controls, etc are each a SOM object 
  85. with methods for drawing, event handling, and customization.
  86.  
  87. */
  88.  
  89. #ifdef __cplusplus
  90. inline CGrafPtr    GetWindowPort(WindowRef w)                     { return (CGrafPtr) w;                                                     }
  91. inline void        SetPortWindowPort(WindowRef aWindowRef)        {    SetPort( (GrafPtr) GetWindowPort(aWindowRef)); }
  92. inline SInt16        GetWindowKind(WindowRef w)                     { return ( *(SInt16 *)    (((UInt8 *) w) + sizeof(GrafPort)));             }
  93. inline void        SetWindowKind(WindowRef    w, SInt16 wKind)    {  *(SInt16 *)    (((UInt8 *) w) + sizeof(GrafPort)) = wKind;              }
  94. inline    Boolean        IsWindowVisible(WindowRef w)                { return *(Boolean *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x2);         }
  95. inline Boolean        IsWindowHilited(WindowRef w)                { return *(Boolean *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x3);        }
  96. inline Boolean        GetWindowGoAwayFlag(WindowRef w)            { return *(Boolean *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x4);        }
  97. inline Boolean        GetWindowZoomFlag(WindowRef w)                { return *(Boolean *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x5);        }
  98. inline void        GetWindowStructureRgn(WindowRef w, RgnHandle r)    {    CopyRgn( *(RgnHandle *)(((UInt8 *) w) + sizeof(GrafPort) + 0x6), r );    }
  99. inline void        GetWindowContentRgn(WindowRef w, RgnHandle r)    {    CopyRgn( *(RgnHandle *)(((UInt8 *) w) + sizeof(GrafPort) + 0xA), r );    }
  100. inline void        GetWindowUpdateRgn(WindowRef w, RgnHandle r)    {    CopyRgn( *(RgnHandle *)(((UInt8 *) w) + sizeof(GrafPort) + 0xE), r );    }
  101. inline SInt16        GetWindowTitleWidth(WindowRef w)                { return *(SInt16 *)(((UInt8 *) w) + sizeof(GrafPort) + 0x1E);            }
  102. inline WindowRef    GetNextWindow(WindowRef w)                        { return *(WindowRef *)    (((UInt8 *) w) + sizeof(GrafPort) + 0x24);        }
  103. inline void    GetWindowStandardState(WindowRef w, Rect *r)  {    Rect *stateRects = (  (Rect *) (**(Handle *) (((UInt8 *) w) + sizeof(GrafPort) + 0x16)));    if (stateRects != NULL)    *r = stateRects[1];        }
  104. inline void    SetWindowStandardState(WindowRef w, const Rect *r)    {     Rect *stateRects = (  (Rect *) (**(Handle *) (((UInt8 *) w) + sizeof(GrafPort) + 0x16))); if (stateRects != NULL)    stateRects[1] = *r;     }
  105. inline void    GetWindowUserState(WindowRef w, Rect *r)    {     Rect *stateRects = (  (Rect *) (**(Handle *) (((UInt8 *) w) + sizeof(GrafPort) + 0x16)));    if (stateRects != NULL)    *r = stateRects[0]; }
  106. inline void    SetWindowUserState(WindowRef w, const Rect *r)    { Rect *stateRects = (  (Rect *) (**(Handle *) (((UInt8 *) w) + sizeof(GrafPort) + 0x16)));    if (stateRects != NULL)    stateRects[0] = *r; }
  107. #else
  108. #define SetPortWindowPort(aWindowRef) SetPort( (GrafPtr) GetWindowPort(aWindowRef) )
  109. #define GetWindowPort(aWindowRef) ( (CGrafPtr) aWindowRef)
  110. #define GetWindowKind(aWindowRef) ( *(SInt16 *)    (((UInt8 *) aWindowRef) + sizeof(GrafPort)))
  111. #define SetWindowKind(aWindowRef, wKind) ( *(SInt16 *)    (((UInt8 *) aWindowRef) + sizeof(GrafPort)) = wKind )
  112. #define IsWindowVisible(aWindowRef) ( *(Boolean *)    (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x2))
  113. #define IsWindowHilited(aWindowRef) ( *(Boolean *)    (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x3))
  114. #define GetWindowGoAwayFlag(aWindowRef) ( *(Boolean *)    (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x4))
  115. #define GetWindowZoomFlag(aWindowRef) ( *(Boolean *)    (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x5))
  116. #define GetWindowStructureRgn(aWindowRef, aRgnHandle) CopyRgn( *(RgnHandle *)(((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x6),  \
  117.     aRgnHandle )
  118. #define GetWindowContentRgn(aWindowRef, aRgnHandle) CopyRgn( *(RgnHandle *)(((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0xA),  \
  119.     aRgnHandle )
  120. #define GetWindowUpdateRgn(aWindowRef, aRgnHandle) CopyRgn( *(RgnHandle *)(((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0xE),  \
  121.     aRgnHandle )
  122. #define GetWindowTitleWidth(aWindowRef) ( *(SInt16 *)    (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x1E))
  123. #define GetNextWindow(aWindowRef) ( *(WindowRef *)    (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x24))
  124. #define GetWindowStandardState(aWindowRef, aRectPtr) do { Rect *stateRects = ( (Rect *) (**(Handle *) (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x16)));     \
  125.     if (stateRects != NULL)    *aRectPtr = stateRects[1]; } while (false)
  126. #define SetWindowStandardState(aWindowRef, aRectPtr) do { Rect *stateRects = ( (Rect *) (**(Handle *) (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x16)));     \
  127.     if (stateRects != NULL)    stateRects[1] = *aRectPtr; } while (false)
  128. #define GetWindowUserState(aWindowRef, aRectPtr) do { Rect *stateRects = ( (Rect *) (**(Handle *) (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x16)));     \
  129.     if (stateRects != NULL)    *aRectPtr = stateRects[0]; } while (false)
  130. #define SetWindowUserState(aWindowRef, aRectPtr) do { Rect *stateRects = ( (Rect *) (**(Handle *) (((UInt8 *) aWindowRef) + sizeof(GrafPort) + 0x16)));     \
  131.     if (stateRects != NULL)    stateRects[0] = *aRectPtr; } while (false)
  132. #endif
  133.  
  134. enum {
  135.     kWindowDefProcType            = 'WDEF'
  136. };
  137.  
  138. /*####################################################################################*/
  139. /**/
  140. /*    Window Definition ID's*/
  141. /**/
  142. /*####################################################################################*/
  143. enum {
  144.     kStandardWindowDefinition    = 0,                            /* for document windows and dialogs*/
  145.     kRoundWindowDefinition        = 1,                            /* old da-style window*/
  146.     kFloatingWindowDefinition    = 124                            /* for floating windows*/
  147. };
  148.  
  149. /*####################################################################################*/
  150. /**/
  151. /* Window Variant Codes*/
  152. /**/
  153. /*####################################################################################*/
  154. enum {
  155. /* for use with kStandardWindowDefinition */
  156.     kModalDialogVariantCode        = 1,
  157.     kMovableModalDialogVariantCode = 5,
  158. /* for use with kFloatingWindowDefinition */
  159.     kSideFloaterVariantCode        = 8
  160. };
  161.  
  162. /*####################################################################################*/
  163. /**/
  164. /* Old-style procIDs.  For use only with New(C)Window*/
  165. /**/
  166. /*####################################################################################*/
  167. enum {
  168.     documentProc                = 0,
  169.     dBoxProc                    = 1,
  170.     plainDBox                    = 2,
  171.     altDBoxProc                    = 3,
  172.     noGrowDocProc                = 4,
  173.     movableDBoxProc                = 5,
  174.     zoomDocProc                    = 8,
  175.     zoomNoGrow                    = 12,
  176.     rDocProc                    = 16,
  177. /* floating window defproc ids */
  178.     floatProc                    = 1985,
  179.     floatGrowProc                = 1987,
  180.     floatZoomProc                = 1989,
  181.     floatZoomGrowProc            = 1991,
  182.     floatSideProc                = 1993,
  183.     floatSideGrowProc            = 1995,
  184.     floatSideZoomProc            = 1997,
  185.     floatSideZoomGrowProc        = 1999
  186. };
  187.  
  188. /*####################################################################################*/
  189. /**/
  190. /* Standard window kinds*/
  191. /**/
  192. /*####################################################################################*/
  193. enum {
  194.     dialogKind                    = 2,
  195.     userKind                    = 8,
  196.     kDialogWindowKind            = 2,
  197.     kApplicationWindowKind        = 8
  198. };
  199.  
  200. /*####################################################################################*/
  201. /**/
  202. /* FindWindow result codes*/
  203. /**/
  204. /*####################################################################################*/
  205. enum {
  206.     inDesk                        = 0,
  207.     inMenuBar                    = 1,
  208.     inSysWindow                    = 2,
  209.     inContent                    = 3,
  210.     inDrag                        = 4,
  211.     inGrow                        = 5,
  212.     inGoAway                    = 6,
  213.     inZoomIn                    = 7,
  214.     inZoomOut                    = 8
  215. };
  216.  
  217. enum {
  218.     wDraw                        = 0,
  219.     wHit                        = 1,
  220.     wCalcRgns                    = 2,
  221.     wNew                        = 3,
  222.     wDispose                    = 4,
  223.     wGrow                        = 5,
  224.     wDrawGIcon                    = 6
  225. };
  226.  
  227. enum {
  228.     deskPatID                    = 16
  229. };
  230.  
  231. /*####################################################################################*/
  232. /**/
  233. /* Window Definition hit test result codes ("WindowPart")*/
  234. /**/
  235. /*####################################################################################*/
  236. enum {
  237.     wNoHit                        = 0,
  238.     wInContent                    = 1,
  239.     wInDrag                        = 2,
  240.     wInGrow                        = 3,
  241.     wInGoAway                    = 4,
  242.     wInZoomIn                    = 5,
  243.     wInZoomOut                    = 6
  244. };
  245.  
  246. typedef pascal long (*WindowDefProcPtr)(short varCode, WindowRef theWindow, short message, long param);
  247. /*
  248.         DeskHookProcPtr uses register based parameters on the 68k and cannot
  249.         be written in or called from a high-level language without the help of
  250.         mixed mode or assembly glue.
  251.  
  252.             typedef pascal void (*DeskHookProcPtr)(Boolean mouseClick, EventRecord *theEvent);
  253.  
  254.         In:
  255.          => mouseClick      D0.B
  256.          => *theEvent       A0.L
  257. */
  258.  
  259. #if GENERATINGCFM
  260. typedef UniversalProcPtr WindowDefUPP;
  261. typedef UniversalProcPtr DeskHookUPP;
  262. #else
  263. typedef WindowDefProcPtr WindowDefUPP;
  264. typedef Register68kProcPtr DeskHookUPP;
  265. #endif
  266.  
  267. enum {
  268.     uppWindowDefProcInfo = kPascalStackBased
  269.          | RESULT_SIZE(SIZE_CODE(sizeof(long)))
  270.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  271.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(WindowRef)))
  272.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short)))
  273.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(long))),
  274.     uppDeskHookProcInfo = kRegisterBased
  275.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterD0, SIZE_CODE(sizeof(Boolean)))
  276.          | REGISTER_ROUTINE_PARAMETER(2, kRegisterA0, SIZE_CODE(sizeof(EventRecord*)))
  277. };
  278.  
  279. #if GENERATINGCFM
  280. #define NewWindowDefProc(userRoutine)        \
  281.         (WindowDefUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppWindowDefProcInfo, GetCurrentArchitecture())
  282. #define NewDeskHookProc(userRoutine)        \
  283.         (DeskHookUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppDeskHookProcInfo, GetCurrentArchitecture())
  284. #else
  285. #define NewWindowDefProc(userRoutine)        \
  286.         ((WindowDefUPP) (userRoutine))
  287. #define NewDeskHookProc(userRoutine)        \
  288.         ((DeskHookUPP) (userRoutine))
  289. #endif
  290.  
  291. #if GENERATINGCFM
  292. #define CallWindowDefProc(userRoutine, varCode, theWindow, message, param)        \
  293.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppWindowDefProcInfo, (varCode), (theWindow), (message), (param))
  294. #define CallDeskHookProc(userRoutine, mouseClick, theEvent)        \
  295.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppDeskHookProcInfo, (mouseClick), (theEvent))
  296. #else
  297. #define CallWindowDefProc(userRoutine, varCode, theWindow, message, param)        \
  298.         (*(userRoutine))((varCode), (theWindow), (message), (param))
  299. /* (*DeskHookProcPtr) cannot be called from a high-level language without the Mixed Mode Manager */
  300. #endif
  301.  
  302. extern pascal RgnHandle GetGrayRgn( void )
  303.     TWOWORDINLINE( 0x2EB8, 0x09EE ); /* MOVE.l $09EE,(SP) */
  304. /*####################################################################################*/
  305. /**/
  306. /*    Color table defined for compatibility only.  Will move to some ifdef'd wasteland.*/
  307. /**/
  308. /*####################################################################################*/
  309. struct WinCTab {
  310.     long                            wCSeed;                        /* reserved */
  311.     short                            wCReserved;                    /* reserved */
  312.     short                            ctSize;                        /* usually 4 for windows */
  313.     ColorSpec                        ctTable[5];
  314. };
  315. typedef struct WinCTab WinCTab;
  316.  
  317. typedef WinCTab *WCTabPtr, **WCTabHandle;
  318.  
  319. extern pascal void InitWindows(void)
  320.  ONEWORDINLINE(0xA912);
  321. extern pascal void GetWMgrPort(GrafPtr *wPort)
  322.  ONEWORDINLINE(0xA910);
  323. extern pascal WindowRef NewWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short theProc, WindowRef behind, Boolean goAwayFlag, long refCon)
  324.  ONEWORDINLINE(0xA913);
  325. extern pascal WindowRef GetNewWindow(short windowID, void *wStorage, WindowRef behind)
  326.  ONEWORDINLINE(0xA9BD);
  327. extern pascal void CloseWindow(WindowRef theWindow)
  328.  ONEWORDINLINE(0xA92D);
  329. extern pascal void DisposeWindow(WindowRef theWindow)
  330.  ONEWORDINLINE(0xA914);
  331. extern pascal void GetWTitle(WindowRef theWindow, Str255 title)
  332.  ONEWORDINLINE(0xA919);
  333. extern pascal void SelectWindow(WindowRef theWindow)
  334.  ONEWORDINLINE(0xA91F);
  335. extern pascal void HideWindow(WindowRef theWindow)
  336.  ONEWORDINLINE(0xA916);
  337. extern pascal void ShowWindow(WindowRef theWindow)
  338.  ONEWORDINLINE(0xA915);
  339. extern pascal void ShowHide(WindowRef theWindow, Boolean showFlag)
  340.  ONEWORDINLINE(0xA908);
  341. extern pascal void HiliteWindow(WindowRef theWindow, Boolean fHilite)
  342.  ONEWORDINLINE(0xA91C);
  343. extern pascal void BringToFront(WindowRef theWindow)
  344.  ONEWORDINLINE(0xA920);
  345. extern pascal void SendBehind(WindowRef theWindow, WindowRef behindWindow)
  346.  ONEWORDINLINE(0xA921);
  347. extern pascal WindowRef FrontWindow(void)
  348.  ONEWORDINLINE(0xA924);
  349. extern pascal void DrawGrowIcon(WindowRef theWindow)
  350.  ONEWORDINLINE(0xA904);
  351. extern pascal void MoveWindow(WindowRef theWindow, short hGlobal, short vGlobal, Boolean front)
  352.  ONEWORDINLINE(0xA91B);
  353. extern pascal void SizeWindow(WindowRef theWindow, short w, short h, Boolean fUpdate)
  354.  ONEWORDINLINE(0xA91D);
  355. extern pascal void ZoomWindow(WindowRef theWindow, short partCode, Boolean front)
  356.  ONEWORDINLINE(0xA83A);
  357. extern pascal void InvalRect(const Rect *badRect)
  358.  ONEWORDINLINE(0xA928);
  359. extern pascal void InvalRgn(RgnHandle badRgn)
  360.  ONEWORDINLINE(0xA927);
  361. extern pascal void ValidRect(const Rect *goodRect)
  362.  ONEWORDINLINE(0xA92A);
  363. extern pascal void ValidRgn(RgnHandle goodRgn)
  364.  ONEWORDINLINE(0xA929);
  365. extern pascal void BeginUpdate(WindowRef theWindow)
  366.  ONEWORDINLINE(0xA922);
  367. extern pascal void EndUpdate(WindowRef theWindow)
  368.  ONEWORDINLINE(0xA923);
  369. extern pascal void SetWRefCon(WindowRef theWindow, long data)
  370.  ONEWORDINLINE(0xA918);
  371. extern pascal long GetWRefCon(WindowRef theWindow)
  372.  ONEWORDINLINE(0xA917);
  373. extern pascal void SetWindowPic(WindowRef theWindow, PicHandle pic)
  374.  ONEWORDINLINE(0xA92E);
  375. extern pascal PicHandle GetWindowPic(WindowRef theWindow)
  376.  ONEWORDINLINE(0xA92F);
  377. extern pascal Boolean CheckUpdate(EventRecord *theEvent)
  378.  ONEWORDINLINE(0xA911);
  379. extern pascal void ClipAbove(WindowRef window)
  380.  ONEWORDINLINE(0xA90B);
  381. extern pascal void SaveOld(WindowRef window)
  382.  ONEWORDINLINE(0xA90E);
  383. extern pascal void DrawNew(WindowRef window, Boolean update)
  384.  ONEWORDINLINE(0xA90F);
  385. extern pascal void PaintOne(WindowRef window, RgnHandle clobberedRgn)
  386.  ONEWORDINLINE(0xA90C);
  387. extern pascal void PaintBehind(WindowRef startWindow, RgnHandle clobberedRgn)
  388.  ONEWORDINLINE(0xA90D);
  389. extern pascal void CalcVis(WindowRef window)
  390.  ONEWORDINLINE(0xA909);
  391. extern pascal void CalcVisBehind(WindowRef startWindow, RgnHandle clobberedRgn)
  392.  ONEWORDINLINE(0xA90A);
  393. extern pascal long GrowWindow(WindowRef theWindow, Point startPt, const Rect *bBox)
  394.  ONEWORDINLINE(0xA92B);
  395. extern pascal short FindWindow(Point thePoint, WindowRef *theWindow)
  396.  ONEWORDINLINE(0xA92C);
  397. extern pascal long PinRect(const Rect *theRect, Point thePt)
  398.  ONEWORDINLINE(0xA94E);
  399. extern pascal long DragGrayRgn(RgnHandle theRgn, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc)
  400.  ONEWORDINLINE(0xA905);
  401. extern pascal long DragTheRgn(RgnHandle theRgn, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc)
  402.  ONEWORDINLINE(0xA926);
  403. extern pascal Boolean TrackBox(WindowRef theWindow, Point thePt, short partCode)
  404.  ONEWORDINLINE(0xA83B);
  405. extern pascal void GetCWMgrPort(CGrafPtr *wMgrCPort)
  406.  ONEWORDINLINE(0xAA48);
  407. extern pascal void SetWinColor(WindowRef theWindow, WCTabHandle newColorTable)
  408.  ONEWORDINLINE(0xAA41);
  409. extern pascal void SetDeskCPat(PixPatHandle deskPixPat)
  410.  ONEWORDINLINE(0xAA47);
  411. extern pascal WindowRef NewCWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowRef behind, Boolean goAwayFlag, long refCon)
  412.  ONEWORDINLINE(0xAA45);
  413. extern pascal WindowRef GetNewCWindow(short windowID, void *wStorage, WindowRef behind)
  414.  ONEWORDINLINE(0xAA46);
  415. extern pascal short GetWVariant(WindowRef theWindow)
  416.  ONEWORDINLINE(0xA80A);
  417. extern pascal void SetWTitle(WindowRef theWindow, ConstStr255Param title)
  418.  ONEWORDINLINE(0xA91A);
  419. extern pascal Boolean TrackGoAway(WindowRef theWindow, Point thePt)
  420.  ONEWORDINLINE(0xA91E);
  421. extern pascal void DragWindow(WindowRef theWindow, Point startPt, const Rect *boundsRect)
  422.  ONEWORDINLINE(0xA925);
  423. #if CGLUESUPPORTED
  424. extern void setwtitle(WindowRef theWindow, const char *title);
  425. extern Boolean trackgoaway(WindowRef theWindow, Point *thePt);
  426. extern short findwindow(Point *thePoint, WindowRef *theWindow);
  427. extern void getwtitle(WindowRef theWindow, char *title);
  428. extern long growwindow(WindowRef theWindow, Point *startPt, const Rect *bBox);
  429. extern WindowRef newwindow(void *wStorage, const Rect *boundsRect, const char *title, Boolean visible, short theProc, WindowRef behind, Boolean goAwayFlag, long refCon);
  430. extern WindowRef newcwindow(void *wStorage, const Rect *boundsRect, const char *title, Boolean visible, short procID, WindowRef behind, Boolean goAwayFlag, long refCon);
  431. extern long pinrect(const Rect *theRect, Point *thePt);
  432. extern Boolean trackbox(WindowRef theWindow, Point *thePt, short partCode);
  433. extern long draggrayrgn(RgnHandle theRgn, Point *startPt, const Rect *boundsRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc);
  434. extern void dragwindow(WindowRef theWindow, Point *startPt, const Rect *boundsRect);
  435. #endif
  436.  
  437. typedef struct WindowRecord WindowRecord;
  438.  
  439. typedef WindowRecord *WindowPeek;
  440.  
  441. struct WindowRecord {
  442.     GrafPort                        port;
  443.     short                            windowKind;
  444.     Boolean                            visible;
  445.     Boolean                            hilited;
  446.     Boolean                            goAwayFlag;
  447.     Boolean                            spareFlag;
  448.     RgnHandle                        strucRgn;
  449.     RgnHandle                        contRgn;
  450.     RgnHandle                        updateRgn;
  451.     Handle                            windowDefProc;
  452.     Handle                            dataHandle;
  453.     StringHandle                    titleHandle;
  454.     short                            titleWidth;
  455.     ControlRef                        controlList;
  456.     WindowPeek                        nextWindow;
  457.     PicHandle                        windowPic;
  458.     long                            refCon;
  459. };
  460. typedef struct CWindowRecord CWindowRecord;
  461.  
  462. typedef CWindowRecord *CWindowPeek;
  463.  
  464. struct CWindowRecord {
  465.     CGrafPort                        port;
  466.     short                            windowKind;
  467.     Boolean                            visible;
  468.     Boolean                            hilited;
  469.     Boolean                            goAwayFlag;
  470.     Boolean                            spareFlag;
  471.     RgnHandle                        strucRgn;
  472.     RgnHandle                        contRgn;
  473.     RgnHandle                        updateRgn;
  474.     Handle                            windowDefProc;
  475.     Handle                            dataHandle;
  476.     StringHandle                    titleHandle;
  477.     short                            titleWidth;
  478.     ControlRef                        controlList;
  479.     CWindowPeek                        nextWindow;
  480.     PicHandle                        windowPic;
  481.     long                            refCon;
  482. };
  483. struct WStateData {
  484.     Rect                            userState;                    /*user state*/
  485.     Rect                            stdState;                    /*standard state*/
  486. };
  487. typedef struct WStateData WStateData;
  488.  
  489. typedef WStateData *WStateDataPtr, **WStateDataHandle;
  490.  
  491. typedef struct AuxWinRec AuxWinRec;
  492.  
  493. typedef AuxWinRec *AuxWinPtr, **AuxWinHandle;
  494.  
  495. struct AuxWinRec {
  496.     AuxWinHandle                    awNext;                        /*handle to next AuxWinRec*/
  497.     WindowRef                        awOwner;                    /*ptr to window */
  498.     CTabHandle                        awCTable;                    /*color table for this window*/
  499.     Handle                            dialogCItem;                /*  */
  500.     long                            awFlags;                    /*reserved for expansion*/
  501.     CTabHandle                        awReserved;                    /*reserved for expansion*/
  502.     long                            awRefCon;                    /*user Constant*/
  503. };
  504. extern pascal Boolean GetAuxWin(WindowRef theWindow, AuxWinHandle *awHndl)
  505.  ONEWORDINLINE(0xAA42);
  506.  
  507. enum {
  508.     wContentColor                = 0,
  509.     wFrameColor                    = 1,
  510.     wTextColor                    = 2,
  511.     wHiliteColor                = 3,
  512.     wTitleBarColor                = 4
  513. };
  514.  
  515.  
  516.  
  517. #if PRAGMA_IMPORT_SUPPORTED
  518. #pragma import off
  519. #endif
  520.  
  521. #if PRAGMA_ALIGN_SUPPORTED
  522. #pragma options align=reset
  523. #endif
  524.  
  525. #ifdef __cplusplus
  526. }
  527. #endif
  528.  
  529. #endif /* __WINDOWS__ */
  530.